package com.tanjie.blackbean.web.annotation;

import com.tanjie.blackbean.pojo.response.BlackBeanResponse;
import com.tanjie.blackbean.pojo.response.ResponseBean;
import org.springframework.core.annotation.AliasFor;
import org.springframework.web.bind.annotation.RestController;

import java.lang.annotation.*;

/**
 * @author: tanjie
 * @date: 2022-04-12
 **/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@PrintLog
@WrapResponse
@RestController
public @interface BlackBeanController {

    // 自定义controller的bean名
    @AliasFor(annotation = RestController.class)
    String value() default "";

    @AliasFor(annotation = WrapResponse.class, attribute = "enable")
    boolean wrapResponseEnable() default true;

    @AliasFor(annotation = WrapResponse.class)
    boolean wrapIfEmpty() default true;

    @AliasFor(annotation = WrapResponse.class)
    Class<? extends ResponseBean> responseType() default BlackBeanResponse.class;

    @AliasFor(annotation = PrintLog.class, attribute = "enable")
    boolean printLogEnable() default true;

    boolean isFeign() default false;

    boolean skipAuth() default false;

}
